//
//  PhotoSectionView.m
//  SportSocial
//
//  Created by yull on 15/1/7.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "PhotoSectionView.h"

@implementation PhotoSectionView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        CGRect rect = CGRectMake(8, 14, 0, 20);
        self.countLabel = [[UILabel alloc] initWithFrame:rect];
        self.countLabel.backgroundColor = [UIColor clearColor];
        self.countLabel.font = [UIFont boldSystemFontOfSize:19.0f];
        self.countLabel.textColor = [UIColor blackColor];
        [self addSubview:self.countLabel];
        
        rect = CGRectMake(0, 20, 0, 14);
        self.timeLabel = [[UILabel alloc] initWithFrame:rect];
        self.timeLabel.backgroundColor = [UIColor clearColor];
        self.timeLabel.font = [UIFont boldSystemFontOfSize:14.0f];
        self.timeLabel.textColor = [UIColor blackColor];
        [self addSubview:self.timeLabel];
    }
    return self;
}

- (void)drawSectionViewWithCount:(NSInteger)count Time:(NSString *)time
{
    self.countLabel.text = [[NSString alloc] initWithFormat:@"%d",count];
    CGSize size = [self.countLabel sizeThatFits:CGSizeZero];
    self.countLabel.width = size.width;
    
    self.timeLabel.text = time;
    self.timeLabel.left = self.countLabel.right + 10;
    size = [self.timeLabel sizeThatFits:CGSizeZero];
    self.timeLabel.width = size.width;
}
@end
